<?php

namespace mpend\controllers;

use Yii;
use yii\rest\Controller;

/**
 * Site controller
 */
class TestController extends Controller {

    /**
     * Displays homepage.
     * @return mixed
     */
    public function actionIndex() {
        $a = 35.9;

        $b = 3590;
        $c = '3590';
        $d = 44.9 - 35;
        $trade = \common\models\trade\Trade::findOne(1);
        $cash = (int) (989 / 100);

        return [
            '00cash' => bcmul(0.58, 100),
            '11cash' => $cash,
            '22cash' => (int) ((0.58 * 1000) / 10),
            'total' => $trade->total * 100,
            'cash2' => (int) ($trade->cash * 100),
            'cash' => $trade->cash * 100,
            'd' => intval(($d * 1000) / 10),
            'd2' => (int) ($d * 100),
            'd3' => gmp_strval($cash),
            'a' => $a * 100,
            'inta' => intval($a * 100),
            'b' => $b,
            'c' => $c,
            'testa=b' => \common\helpers\StringHelper::compareNumber($a * 100, $b),
            'testa=c' => \common\helpers\StringHelper::compareNumber($a * 100, $c),
        ];
    }

}
